package com.lti.appnet.module.repository;

import com.lti.appnet.module.domain.Category;
import org.springframework.data.mongodb.repository.MongoRepository;
import org.springframework.data.mongodb.repository.Query;

import java.util.List;

/**
 * Created by sinceow on 2014/7/30.
 */
public interface CategoryRepository extends MongoRepository<Category, String> {

    public List<Category> findByAuthorId(String authorId);

    public List<Category> findByModuleId(String moduleId);

    @Query(value = "{'moduleId':?0,'authorId': ?1}")
    public List<Category> findByModuleIdAndAuthorId(String moduleId, String authorId);
}
